﻿using System;

namespace HslCommunication.Core.IMessage
{
	/// <summary>
	/// 南京自动化研究所推出的DCS设备的消息类
	/// </summary>
	// Token: 0x0200014F RID: 335
	public class DcsNanJingAutoMessage : INetMessage
	{
		/// <inheritdoc cref="P:HslCommunication.Core.IMessage.INetMessage.ProtocolHeadBytesLength" />
		// Token: 0x170005BB RID: 1467
		// (get) Token: 0x06001CDF RID: 7391 RVA: 0x0008CC1C File Offset: 0x0008AE1C
		public int ProtocolHeadBytesLength
		{
			get
			{
				return 6;
			}
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IMessage.INetMessage.GetContentLengthByHeadBytes" />
		// Token: 0x06001CE0 RID: 7392 RVA: 0x0008CE08 File Offset: 0x0008B008
		public int GetContentLengthByHeadBytes()
		{
			byte[] headBytes = this.HeadBytes;
			int? num = (headBytes != null) ? new int?(headBytes.Length) : null;
			int protocolHeadBytesLength = this.ProtocolHeadBytesLength;
			bool flag = num.GetValueOrDefault() >= protocolHeadBytesLength & num != null;
			int result;
			if (flag)
			{
				result = (int)this.HeadBytes[4] * 256 + (int)this.HeadBytes[5];
			}
			else
			{
				result = 0;
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IMessage.INetMessage.CheckHeadBytesLegal(System.Byte[])" />
		// Token: 0x06001CE1 RID: 7393 RVA: 0x0008CD5E File Offset: 0x0008AF5E
		public bool CheckHeadBytesLegal(byte[] token)
		{
			return true;
		}

		/// <inheritdoc cref="M:HslCommunication.Core.IMessage.INetMessage.GetHeadBytesIdentity" />
		// Token: 0x06001CE2 RID: 7394 RVA: 0x0008CE76 File Offset: 0x0008B076
		public int GetHeadBytesIdentity()
		{
			return (int)this.HeadBytes[0] * 256 + (int)this.HeadBytes[1];
		}

		/// <inheritdoc cref="P:HslCommunication.Core.IMessage.INetMessage.HeadBytes" />
		// Token: 0x170005BC RID: 1468
		// (get) Token: 0x06001CE3 RID: 7395 RVA: 0x0008CE8F File Offset: 0x0008B08F
		// (set) Token: 0x06001CE4 RID: 7396 RVA: 0x0008CE97 File Offset: 0x0008B097
		public byte[] HeadBytes { get; set; }

		/// <inheritdoc cref="P:HslCommunication.Core.IMessage.INetMessage.ContentBytes" />
		// Token: 0x170005BD RID: 1469
		// (get) Token: 0x06001CE5 RID: 7397 RVA: 0x0008CEA0 File Offset: 0x0008B0A0
		// (set) Token: 0x06001CE6 RID: 7398 RVA: 0x0008CEA8 File Offset: 0x0008B0A8
		public byte[] ContentBytes { get; set; }

		/// <inheritdoc cref="P:HslCommunication.Core.IMessage.INetMessage.SendBytes" />
		// Token: 0x170005BE RID: 1470
		// (get) Token: 0x06001CE7 RID: 7399 RVA: 0x0008CEB1 File Offset: 0x0008B0B1
		// (set) Token: 0x06001CE8 RID: 7400 RVA: 0x0008CEB9 File Offset: 0x0008B0B9
		public byte[] SendBytes { get; set; }
	}
}
